﻿#region Usings

using System.Windows;
using ScrumTable.UI.ViewModel.Controller;
using System.Linq;

#endregion

namespace ScrumTable.UI.View.WinTouch.UserControls.Menu.MenuItems
{
    /// <summary>
    /// MenuEntry 
    /// </summary>
    public class MenuEntry : Menu
    {

        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------
      
        #endregion
        
        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------
        public virtual string TextAsRessourceString { get; set; }

        public override string Text
        {
            get { return Localization.LanguageDictionary.Current.Translate<string>(TextAsRessourceString, "Text"); }
        }


        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

      
        
        
        #endregion




        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        public override void Action()
        {
            if (NavigatonTarget == NavigationTarget.Null)
            {
                if (Children.Count > 0)
                {
                    Children[0].Action();
                    return;
                }
            }
            else
            {
                NaviController.GoTo(NavigatonTarget);
            }
        }


        #endregion


        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------
      

        #endregion

    }
}
